package cn.hyzyyy.zxmtools.controller;

import cn.hyzyyy.zxmtools.model.AData;
import com.kfyty.loveqq.framework.core.lang.Value;
import com.kfyty.loveqq.framework.javafx.core.AbstractController;
import com.kfyty.loveqq.framework.javafx.core.annotation.FController;
import javafx.fxml.FXML;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.AnchorPane;
import javafx.stage.WindowEvent;

@FController(value = "home", path = "/fxml/home.fxml", title = "home", show = true)
public class HomeController extends AbstractController<AnchorPane>{

    @FXML
    public TableColumn<AData,String> aColumn;

    @FXML
    public TableColumn<AData,String> bColumn;

    @FXML
    public TableView<AData> tableView;

    private Value<String> a; //这里具体的写法。。

//    public Value<String> getA() {
//        return a;
//    }
//
//    public void setA(Value<String> a) {
//        this.a = a;
//    }

    @Override
    public void onShown(WindowEvent event){
        System.out.println(a.get()); //获取都是null
        aColumn.setCellValueFactory(new PropertyValueFactory<>("a"));
        bColumn.setCellValueFactory(new PropertyValueFactory<>("b"));

    }


}
